// pages/basics/basics.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    showTriggered: true,
    TabCur: 0,
    scrollLeft: 0,
    scroollType: [{
        name: "英雄联盟"
      },
      {
        name: "王者荣耀"
      },
      {
        name: "刺激战场"
      },
      {
        name: "和平精英"
      },
      {
        name: "摩尔庄园"
      }
    ],
    swiperList: [{
      id: 0,
      type: 'image',
      url: 'https://7371-sqw88-6gmvufl8439317df-1304806617.tcb.qcloud.la/campus_E-sportsCircle_Category/gameType/CF.png?sign=590f4dc3ca158c1ca968e1650e108ef3&t=1624700755'
    }, {
      id: 1,
      type: 'image',
      url: 'https://7371-sqw88-6gmvufl8439317df-1304806617.tcb.qcloud.la/campus_E-sportsCircle_Category/gameType/OverWatch.jpeg?sign=f04a1149021f88d5563ba9e8c57a8dae&t=1624701002'
    }, {
      id: 2,
      type: 'image',
      url: 'https://7371-sqw88-6gmvufl8439317df-1304806617.tcb.qcloud.la/campus_E-sportsCircle_Category/gameType/LOL.png?sign=f60417ea874a538fd63e395b7ff2fcd2&t=1624700651'
    }, {
      id: 3,
      type: 'image',
      url: 'https://7371-sqw88-6gmvufl8439317df-1304806617.tcb.qcloud.la/campus_E-sportsCircle_Category/gameType/PUBG.png?sign=47f8d13824f86035c95bc5b6171d891f&t=1624700736'
    }, {
      id: 4,
      type: 'image',
      url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big25011.jpg'
    }, {
      id: 5,
      type: 'image',
      url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big21016.jpg'
    }, {
      id: 6,
      type: 'image',
      url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big99008.jpg'
    }]
  },

  tabSelect(e) {
    this.setData({
      TabCur: e.currentTarget.dataset.id,
      scrollLeft: (e.currentTarget.dataset.id - 1) * 60
    })
  },

  searchButton: function () {
    console.log("搜查按钮被点击");
  },

  //监听下拉事件完成
  bindrefresherrefresh() {
    wx.showToast({
      title: '刷新中..',
      icon: 'loading',
      duration: 1500
    })
    setTimeout(() => {
      this.setData({
        showTriggered: false
      })
    }, 1500)
  },

  //监听下拉事件触发
  refresh: function (e) {
    if (e.detail.dy > 60) {
      console.log("达到阈值60")
    }
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: async function (options) {

  },


  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
    wx.hideToast({})
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})